<template>
	<view class="success-container">
		<!-- 顶部渐变区域 -->
		<view class="gradient-section">
			
			<!-- 支付金额 -->
			<view class="amount-display">
				<text class="amount-text">¥ {{ paymentAmount }}</text>
			</view>
			
			<!-- 操作按钮 -->
			<view class="action-buttons">
				<view class="action-btn" @click="viewOrder">
					<text class="btn-text">查看订单</text>
				</view>
				<view class="action-btn" @click="backToHome">
					<text class="btn-text">回到首页</text>
				</view>
			</view>
		</view>
		
		<!-- 底部白色卡片 -->
		<view class="card-section">
			<view class="success-card">
				<!-- 成功消息 -->
				<view class="success-message">
					<text class="success-text">订单支付成功!</text>
				</view>
				
				<!-- 支付方式 -->
				<view class="payment-method">
					<text class="method-label">支付方式:</text>
					<text class="method-value">微信</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				orderId: '', // 订单ID
				paymentAmount: '1.00'
			}
		},
		onLoad(options) {
			// 接收传递过来的订单ID和支付金额
			if (options.orderId) {
				this.orderId = decodeURIComponent(options.orderId);
			}
			if (options.amount) {
				this.paymentAmount = decodeURIComponent(options.amount);
			}
		},
		methods: {
			// 查看订单
			viewOrder() {
				if (this.orderId) {
					// 跳转到订单详情页面
					uni.navigateTo({
						url: `/pages/wodedingdan/wodedingdan?orderId=${encodeURIComponent(this.orderId)}`
					});
				} else {
					// 跳转到订单列表页面
					uni.switchTab({
						url: '/pages/wode/wode'
					});
				}
			},
			
			// 回到首页
			backToHome() {
				uni.switchTab({
					url: '/pages/index/index'
				});
			}
		}
	}
</script>

<style scoped>
	.success-container {
		min-height: 100vh;
		background-color: #f5f5f5;
	}

	/* 顶部渐变区域 */
	.gradient-section {
		background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 50%, #FFD93D 100%);
		padding: 60rpx 40rpx 80rpx;
		position: relative;
	}

	

	.control-icon {
		width: 40rpx;
		height: 40rpx;
		background-color: rgba(255, 255, 255, 0.3);
		border-radius: 50%;
		display: flex;
		align-items: center;
		justify-content: center;
		color: white;
		font-size: 24rpx;
		font-weight: bold;
	}

	/* 支付金额显示 */
	.amount-display {
		text-align: center;
		margin-bottom: 60rpx;
	}

	.amount-text {
		font-size: 72rpx;
		font-weight: bold;
		color: white;
		text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
	}

	/* 操作按钮 */
	.action-buttons {
		display: flex;
		gap: 30rpx;
		justify-content: center;
	}

	.action-btn {
		background-color: transparent;
		border: 2rpx solid white;
		border-radius: 50rpx;
		padding: 20rpx 40rpx;
		min-width: 200rpx;
		text-align: center;
		transition: all 0.3s ease;
	}

	.action-btn:active {
		background-color: rgba(255, 255, 255, 0.2);
	}

	.btn-text {
		color: white;
		font-size: 32rpx;
		font-weight: bold;
	}

	/* 底部白色卡片 */
	.card-section {
		margin-top: -40rpx;
		padding: 0 40rpx;
		position: relative;
		z-index: 1;
	}

	.success-card {
		background-color: #FFE4E1;
		border-radius: 20rpx;
		padding: 40rpx;
		box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.1);
	}

	/* 成功消息 */
	.success-message {
		text-align: center;
		margin-bottom: 30rpx;
	}

	.success-text {
		font-size: 36rpx;
		font-weight: bold;
		color: #FF4757;
	}

	/* 支付方式 */
	.payment-method {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 20rpx 0;
		border-top: 1rpx solid rgba(255, 71, 87, 0.2);
	}

	.method-label {
		font-size: 28rpx;
		color: #333333;
	}

	.method-value {
		font-size: 28rpx;
		color: #333333;
		font-weight: bold;
	}
</style> 